<template>
    <div class="index-wrap">
        <div class="index-left">
            <div class="index-left-block">
              <h3>全部产品</h3>
              <template v-for="product in productList">
                <h4>{{product.title}}</h4>
                <ul>
                  <li v-for="item in product.list">
                    <a :href="item.url">{{item.title}}</a>
                    <span v-if="item.hot" class=hot-tag>HOT</span>
                  </li>
                </ul>
                <div v-if="!product.last" class="hr"></div>
              </template>
              
            </div>
            <div class="index-left-block last-news">
              <h3>最新消息</h3>
              <ul>
                <li v-for="news in newsList">
                  <a :href="news.url">{{news.title}}</a>
                </li>
              </ul>
            </div>
        </div>
        <div class="index-right">
          <div class="pic banner1"></div>
          <div class="index-abort-list">

            <div v-for="(board,index) in boardList" class="list-item" :class="{'right-space':index%2===0}">
              <div class="list-item-left">
                <img src="../assets/goodsIcon/001.png"/>
              </div>
              <div class="list-item-right">
                <h4>{{board.title}}</h4>
                <p>{{board.description}}</p>
                <a class="buyBtn">立即购买</a>
              </div>
            </div>
          </div>
        </div>
    </div>
</template>

<script>
    export default{
        name:'index',
        data(){
            return{
              boardList:[
                {
                  title:'开放产品',
                  description:'开放产品是一款升级产品。',
                  saleout:true
                },
                {
                  title:'品牌营销',
                  description:'品牌营销助你们更好地找到定位。',
                  saleout:false,
                },
                {
                  title:'使命必达',
                  description:'使命必达永远保持最前端的速度。',
                  saleout:false,
                },
                {
                  title:'勇攀高峰',
                  description:'帮你永攀高峰，到达事业顶峰。',
                  saleout:true,
                },
              ],
              newsList:[
                {
                  title:'网易',
                  url:'http://www.163.com'
                },
                {
                  title:'新浪',
                  url:'http://www.sina.com'
                },
                {
                  title:'慕课',
                  url:'http://www.imooc.com'
                },
                {
                  title:'码云',
                  url:'http://www.gitee.com'
                },
                {
                  title:'谷歌',
                  url:'http://www.google.com'
                },
                {
                  title:'极客学院',
                  url:'http://www.jikexueyuan.com'
                }
              ],
              productList:{
                pc:{
                    title:'PC产品',
                    list:[
                        {
                            title:'百度',
                            url:'http://www.baidu.com',
                            hot:true
                        },
                        {
                            title:'阿里巴巴',
                            url:'http://www.alibaba.com',
                            hot:true
                        },
                        {
                            title:'腾讯',
                            url:'http://www.qq.com'
                        }
                    ]
                },
                app:{
                    title:'应用类',
                    last:true,  
                    list:[
                        {
                            title:'百度手机',
                            url:'http://www.baidu.com'
                        },
                        {
                            title:'阿里巴巴手机',
                            url:'http://www.alibaba.com'
                        },
                        {
                            title:'腾讯手机',
                            url:'http://www.qq.com',
                            hot:true
                        }
                    ]
                }

              }
            }
        }
    }
</script>
<style scoped>
  .index-wrap{
    width: 1000px;
    height: auto;
    margin: 20px auto;
    /*background-color: #a0b25f;*/
  }
  .index-left{
    width: 230px;
    height: auto;
    float: left;
  }
  .index-left-block{
    margin: 0px;
  }
  .index-left h3{
    background-color: #2ab28c;
    color: white;
    padding: 2px 7px;
    margin: 0px;
  }
  .index-left h4{
    padding: 2px 7px;
    color:#000;
  }
  .index-left-block{
    background-color: white;
    padding-bottom: 5px;
    margin-bottom: 20px;
  }
  .index-left-block li{
    list-style: none;
  }
  .index-left-block li a{
    text-decoration: none;
    color: #333;
  }
  .index-left-block li span{
    background-color: red;
    color: white;
  }
  .hr{
    background-color: #f5f5f5;
    height: 3px;
  }
  .last-news{
    height: 325px;
  }
  .index-right{
    width: 750px;
    height: auto;
    float: right;
  }
  .pic{
    width: 750px;
    height: 420px;
  }
  .banner1{
    background: url("../assets/banner/p01.jpg") no-repeat;
  }
  .index-abort-list{
    width: 750px;
    height: 260px;
  }
  .list-item{
    width: 365px;
    height: 120px;
    background-color: white;
    float: left;
    margin-bottom: 20px;
  }
  .right-space{
    margin-right: 20px;
  }
  .list-item-left{
    width: 80px;
    height: 80px;
    float: left;
    padding: 20px;
    word-wrap: break-word;
  }
  .list-item-left img{
    width: 80px;
    height: 80px;
  }
  .list-item-right{
    width: 215px;
    height: 90px;
    float: left;
    padding: 15px;
    word-wrap: break-word;
  }
  .list-item-right h4,p{
    padding: 0px;
    margin: 0px;
  }
  .list-item-right p{
    line-height: 30px;
    font-size: 14px;
    color: #333;
  }
  .buyBtn{
    width: 80px;
    background-color: #2ab28c;
    border: none;
    color: white;
    font-size: 12px;
    padding: 5px 10px;
  }

</style>
